<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>


    <script src="../js/vue.js"></script>
    <script src="../js/axios.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            list-style: none;
        }

        #app {
            position: relative;
            overflow: hidden;
        }

        .table {
            width: 500px;
            margin: 50px auto;
            /* height: auto; */
            overflow: hidden;
            position: relative;
        }

        .table .item {
            width: 100px;
            height: 40px;
            line-height: 40px;
            text-align: center;
            background-color: burlywood;
            color: cornflowerblue;
            float: left;
        }
    </style>
</head>

<body>
    <div id="app">

        <div class="table">
            <div class="tr">
                <div class="item">编号</div>
                <div class="item">用户名</div>
                <div class="item">密码</div>
                <div class="item">操作</div>
                <div class="item">操作</div>
            </div>

            <div class="tr" v-for="item in list">
                <div class="item">{{item.id}}</div>
                <div class="item">{{item.username}}</div>
                <div class="item">{{item.userpwd}}</div>
                <div class="item" @click="del(item.id)">删除</div>
                <div class="item" v-show="flag1!=flag" @click="upd(item.id)">修改</div>
                <div class="item" v-show="flag==item.id">
                    <button @click="save">提交</button>
                    <button @click="cancel">取消</button>
                </div>
            </div>
        </div>
    </div>
</body>

</html>